****FIGURE 4****

cd "$main_dir/output/figures/main"

graph set window fontface "Palatino"

//--------------------------------------------------------
//Read in relevant datasets
//--------------------------------------------------------

clear
use "$data_dir/clean/harmonized_pooled_averages.dta"
merge 1:1 ccode using "$data_dir/raw/average_growth_rates_mpd.dta"
drop if _merge==2
drop _merge

sort ccode
gen sample = 1 if ccode!="VEN" & ccode!="YEM" & ccode!="CAF" //omit outliers

//--------------------------------------------------------
//Create Figure 4
//--------------------------------------------------------

scatter trust_govt_wo avg_10yr_growth if trust_govt_wo!=. & sample==1, mlabel(ccode) msize(vsmall) mlabsize(vsmall) mlabcolor(black) legend(off) || lfit trust_govt_wo avg_10yr_growth if trust_govt_wo!=. & sample==1, lcolor(maroon) graphregion(color(white)) bgcolor(white) ylabel(,labs(small) format(%9.2f)) xlabel(-0.05(0.05)0.1,labs(small)) xtitle("Average 10-Year Growth", margin(small) size(small)) ytitle("Trust in Government", margin(small) size(small)) 
graph export "figure_4.png", replace
graph export "figure_4.tif", replace as(tif) width(3600)
